package sicnu.cs.ich.api.domain.form;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import sicnu.cs.ich.api.common.annotations.transaction.EncryptTransaction;
import sicnu.cs.ich.api.common.annotations.transaction.SensitiveData;

import javax.validation.constraints.*;
import java.io.Serializable;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@SensitiveData
public class UserForm implements Serializable {
    @NotBlank(message = "USERNAME不能为空")
    @Size(min = 8, max = 16, message = "用户名必须为8-16位")
    private String username;
    @NotBlank(message = "EMAIL不能为空")
    @EncryptTransaction
    @Email
    private String email;
    @NotBlank
    @Size(min = 6, max = 12, message = "密码大小在6-12个字符")
    private String password;
    //@NotBlank
    @Size(min = 11, max = 11, message = "电话不合法")
    @EncryptTransaction
    private String mobile;

    @Size(min = 4, max = 10, message = "昵称必须在4-10位")
    private String nickName;

    /**
     * 0女 1男
     */
    @Max(value = 1)
    @Min(value = 0)
    @NotNull
    private Integer gender;
    /**
     * 用户id
     */
    private Integer id;

    private String code;
}
